package db

const TableNameWarehouseMaterial = TablePrefix + "warehouse_material"

type WarehouseMaterial struct {
	BaseModel
	UID    uint  `gorm:"column:uid;type:int(11);default:0;comment:用户id" json:"uid" form:"uid"`             // 用户id
	TypeID uint  `gorm:"column:type_id;type:int(11);default:0;comment:类型id" json:"type_id" form:"type_id"` // 类型id
	Num    int64 `gorm:"column:num;type:int(11);default:0;comment:数量" json:"num" form:"num"`               // 数量
}

func (*WarehouseMaterial) TableName() string {
	return TableNameWarehouseMaterial
}

type WarehouseMaterialHasOneType struct {
	WarehouseMaterial
	Types  Type                             `gorm:"foreignKey:ID;references:TypeID" json:"types"`
	Donate []TypeCardDonateHaxOneTypeOfRole `gorm:"foreignKey:TypeID;references:TypeID" json:"donate"`
}
